Release 10.1A: OpenEdge Development:
Programming Interfaces


cancel-import-from-xml procedure

Delete the persistent procedure started in the policies-dataset-read-xml procedure to load an XML file. This should only be called if the call to policies-dataset-read-xml returns a list of duplicate policy names and the caller decides not to call the override-policies-from-xml procedure to override the policies.

Parameters: None

Example: The following example is a combination of pseudo-code and 4GL that shows how the cancel-import-from-xml procedure, policies-dataset-read-xml procedure, and override-policies-from-xml procedure can be used together:

Calling API procedures to import audit policies in XML 
{auditing/include/_aud-utils.i} 
RUN policies-dataset-read-xml IN hAuditUtils  
    (INPUT pcxmlFileName,  
     INPUT-OUTPUT DATASET-HANDLE hAuditDset BY-REFERENCE, 
     OUTPUT pcList, 
     OUTPUT pcErrorMsg). 
/* either display error message or  
   confirmation that the policies were imported  
*/ 
IF errorMsg <> "":U THEN 
    MESSAGE errorMsg VIEW-AS ALERT-BOX ERROR. 
ELSE DO: 
    /* check if XML file has policies which already exist */ 
    IF cDupList <> "" THEN DO: 
        MESSAGE "The following policies already exist:" SKIP  
            REPLACE(cDupList,",",CHR(10)) SKIP 
            "Do you want to override them?" SKIP  
            "(If Yes, the listed policies will be deleted and re-imported)"  
            VIEW-AS ALERT-BOX QUESTION BUTTON YES-NO  
            UPDATE choice AS LOGICAL. 
        IF choice = TRUE THEN DO: 
            /* user confirmed that he wants to override existing policies, 
               so let's pick up from where we left off. Keep the changes. 
            */ 
            RUN setcursor ("WAIT":U). 
            RUN override-policies-from-xml 
                (INPUT-OUTPUT DATASET-HANDLE hAuditDset BY-REFERENCE, 
                 OUTPUT pcErrorMsg). 
            RUN setcursor ("":U). 
            IF errorMsg <> "" THEN 
                MESSAGE errorMsg VIEW-AS ALERT-BOX ERROR. 
        END. 
        ELSE DO: 
            /* user doesn't want to override policies,  
               to cancel the previous request 
            */ 
            RUN cancel-import-from-xml IN hAuditUtils. 
            MESSAGE "Import canceled" VIEW-AS ALERT-BOX INFO. 
        END. 
    END. 


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095